/**
 * 
 */
package zaphod.toy.ogametool.ui;

import org.eclipse.jface.viewers.BaseLabelProvider;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.swt.graphics.Image;

import zaphod.toy.ogametool.core.model.Colony;

final class BaseLabelProviderImplementation extends BaseLabelProvider implements
    IBaseLabelProvider, ITableLabelProvider
{
    public Image getColumnImage( Object arg0, int arg1 )
    {
        Image result = null;
        // if ( arg0 instanceof Colony )
        // {
        // ImageRegistry imageRegistry =
        // ScoutParserUtility.getInstance().getImageRegistry();
        // switch ( arg1 )
        // {
        // case 1 :
        // result = imageRegistry.get( ScoutParserUtility.METAL );
        // break;
        // case 2 :
        // result = imageRegistry.get( ScoutParserUtility.CRYSTAL );
        // break;
        // case 3 :
        // result = imageRegistry.get( ScoutParserUtility.DEUTERIUM );
        // break;
        //
        // }
        //
        // }
        return result;
    }

    public String getColumnText( Object arg0, int arg1 )
    {
        String result = "";
        if ( arg0 instanceof Colony )
        {
            Colony c = (Colony) arg0;
            switch ( arg1 )
            {
                case 0 :
                    result = c.getLocation();
                    break;
                case 1 :
                    result = String.format( "%1$,d", c.metal );
                    break;
                case 2 :
                    result = String.format( "%1$,d", c.crystal );
                    break;
                case 3 :
                    result = String.format( "%1$,d", c.deuterium );
                    break;
                case 4 :
                    result = String.format( "%1$,d", c.getValue() );
                    break;
                case 5 :
                    result = String.format( "%1$,d", c.getGrossBulk() );
                    break;
                case 6 :
                    result = String.format( "%1$,d", c.energy );
                    break;
                case 7 :
                    result = Integer.toString( c.divisor );
                    break;
                default :
                    result = "!";

            }
        }
        return result;
    }
}